﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbBlock2PtParameter : OdDbBlockParameter
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbBlock2PtParameter(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbBlock2PtParameter_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbBlock2PtParameter obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbBlock2PtParameter()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbBlock2PtParameter(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbBlock2PtParameter cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlock2PtParameter_cast(OdRxObject.getCPtr(pObj));
			OdDbBlock2PtParameter result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlock2PtParameter_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlock2PtParameter_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlock2PtParameter_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbBlock2PtParameter createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlock2PtParameter_createObject();
			OdDbBlock2PtParameter result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlock2PtParameter)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlock2PtParameter_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlock2PtParameter_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d basePoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_basePoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d endPoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_endPoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double distance()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_distance(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double angle()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_angle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlock2PtParameter.ParameterBaseLocation baseLocation()
		{
			OdDbBlock2PtParameter.ParameterBaseLocation result = (OdDbBlock2PtParameter.ParameterBaseLocation)TD_DbPINVOKE.OdDbBlock2PtParameter_baseLocation(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d definitionBasePoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_definitionBasePoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d definitionEndPoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_definitionEndPoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double definitionDistance()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_definitionDistance(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double definitionAngle()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_definitionAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d updatedBasePoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_updatedBasePoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d updatedEndPoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlock2PtParameter_updatedEndPoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double updatedDistance()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_updatedDistance(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double updatedAngle()
		{
			double result = TD_DbPINVOKE.OdDbBlock2PtParameter_updatedAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(TD_DbPINVOKE.OdDbBlock2PtParameter_normal(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlockGrip getAssociatedGrip(OdDbBlockParameter.ParameterComponent arg0, OpenMode arg1)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlock2PtParameter_getAssociatedGrip(this.swigCPtr, (int)arg0, (int)arg1);
			OdDbBlockGrip result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockGrip)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockGrip)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockGrip)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void graphEvalEnd(bool arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_graphEvalEnd(this.swigCPtr, arg0);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool parameterComponentHasAction(OdDbBlockParameter.ParameterComponent arg0, OdDbBlockAction arg1)
		{
			bool result = TD_DbPINVOKE.OdDbBlock2PtParameter_parameterComponentHasAction(this.swigCPtr, (int)arg0, OdDbBlockAction.getCPtr(arg1));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBaseLocation(OdDbBlock2PtParameter.ParameterBaseLocation arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setBaseLocation(this.swigCPtr, (int)arg0);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setBasePoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setBasePoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setEndPoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setEndPoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDefinitionBasePoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setDefinitionBasePoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDefinitionEndPoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setDefinitionEndPoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setUpdatedBasePoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setUpdatedBasePoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setUpdatedEndPoint(OdGePoint3d arg0)
		{
			TD_DbPINVOKE.OdDbBlock2PtParameter_setUpdatedEndPoint(this.swigCPtr, OdGePoint3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum ParameterBaseLocation
		{
			start,
			mid
		}
	}
}
